package com.rr.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author RR
 * @date 2022/6/21 22:00
 */
@RestController
@RefreshScope
public class TestController {


    @Value("${server.port}")
    private Integer port;
    @Value("${nacos.info}")
    private String nacosInfo;

    @GetMapping("/test/get")
    public String testGetPort() {
        return port.toString();
    }

    @GetMapping("/test/getNacosInfo")
    public String testGetNacosInfo() {
        return nacosInfo;
    }

}
